<?php require_once 'header.php';?>
<div id="content">
<body>

     <script type="text/javascript" language="javascript" src="../js/jquery-1.7.1.js"></script>
        <script type="text/javascript" language="javascript" src="../DataTables-1.8.2/media/js/jquery.js"></script>
		<script type="text/javascript" language="javascript" src="../DataTables-1.8.2/media/js/jquery.dataTables.js"></script>
		<script type="text/javascript" charset="utf-8" src="../DataTables-1.8.2/extras/TableTools/media/js/ZeroClipboard.js"></script>
		<script type="text/javascript" charset="utf-8" src="../DataTables-1.8.2/extras/TableTools/media/js/TableTools.js"></script>
	    <script type="text/javascript" charset="utf-8" src="../DataTables-1.8.2/extras/TableTools/media/js/TableTools.min.js"></script> 
	         
<script type="text/javascript" charset="utf-8">
var n=3;
$(document).ready(function() {
    $('#data').dataTable( {
        "aoColumns": [ 
                      { "sWidth": "1%" },
                      { "sWidth": "1%" },
                      { "sWidth": "10%" },
                      { "sWidth": "10%" },
                      { "sWidth": "1%" },
                      { "sWidth": "20%" },
                      { "sWidth": "1%" },
                      { "sWidth": "1%" },
                     
                      {
                       // "mDataProp": "Action",
                    	  "sWidth": "15%",
                      //  "sDefaultContent": '<a href="" title=""><img src="./images/icons/icon_edit.png" alt="Edit" /></a>    <a href="actions/freischalten.php?id='+n+'" title=""><img src="./images/icons/icon_approve.png" alt="Approve" /></a>    <a href="" title=""><img src="./images/icons/icon_unapprove.png" alt="Unapprove" /></a>    <a href="" title=""><img src="./images/icons/icon_delete.png" alt="Delete" /></a>',
                        
                       
                      }
                      
                    ],
    	"bJQueryUI": true,
    	"aaSorting": [],
        "bProcessing": true,
        "sPaginationType": "full_numbers",
        "bServerSide": true,
        "bInfo": true,
        "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
			/* Append the grade to the default row class name */
			if ( aData[7] == "0" )
			{
				$('td:eq(7)', nRow).html( '<b>nein</b>' );
				$('td:eq(7)', nRow).css("color", "red");
			}else if(aData[7] == "1"){
				$('td:eq(7)', nRow).html( '<b>ja</b>' );
				$('td:eq(7)', nRow).css("color", "green");

				}
			if(aData[6] == null){
				$('td:eq(6)', nRow).html( '<b>offline</b>' );
				$('td:eq(6)', nRow).css("color", "red");

				}else{
					$('td:eq(6)', nRow).html( '<b>online</b>' );
					$('td:eq(6)', nRow).css("color", "green");
					}
			if(aData[8]!=0){
				$('td:eq(8)', nRow).html( '<a  href="actions/freischalten.php?id='+aData[0]+'" title="freischalten" onClick="return confirm(\'Wollen Sie wirklich diesen User freischalten?\'); "><img src="./images/icons/icon_approve.png" alt="Approve"/></a> <a href="actions/sperren.php?id='+aData[0]+'" title="sperren" onClick="return confirm(\'Wollen Sie wirklich diesen User sperren?\'); "><img src="./images/icons/icon_unapprove.png" alt="Unapprove" /></a> <a href="user_editieren.php?id='+aData[0]+'" title="editieren" onClick="return confirm(\'Wollen Sie wirklich diesen User editieren?\'); "><img src="./images/icons/icon_edit.png" alt="Edit" /></a>' );

				}
			return nRow;
		},
      
        "sAjaxSource": "user_list_server_processing.php"
    } );
} );
function decorateRow(row) {
    $(row).children().each(function(index, td){
        if ($(td).html()==='0') {
        	$(td).html('nein');
            $(td).css("color", "red");
        }
        else if($(td).html()==='1') {
        	$(td).html('ja');
            $(td).css("color", "green");
        }
    });
     
}
</script>
<!-- Table styles start -->           
                <div class="container">
                	<div class="conthead">
                		<h2>User</h2>
                    </div>
                	<div class="contentbox" >
                        <table id="data" cellpadding="0" cellspacing="0" border="0" class="display">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>Anrede</th>
                                    <th>Name</th>
                                    <th>Vorname</th>
                                    <th>Titel</th>
                                    <th>E-Mail</th>
                                    <th>Status</th>
                                    <th>Frei</th>
                                    <th>Action</th>
                                   
                                </tr>
                            </thead>
                            <tbody>
                            
                              
                                 
                            </tbody>
                        </table>
                        <div class="extrabottom">
                        	
                        
                        </div>
                    </div>
                </div>
<!-- Table styles end -->  
</body>
</div>
</body>
<!-- Right side end  -->

		<script type="text/javascript" src="http://dwpe.googlecode.com/svn/trunk/_shared/EnhanceJS/enhance.js"></script>	
   		<script type='text/javascript' src='http://dwpe.googlecode.com/svn/trunk/charting/js/excanvas.js'></script>
       
        <script type='text/javascript' src='./js/jquery.fancybox-1.3.4.pack.js'></script>
        <script type='application/javascript' src='./js/fullcalendar.min.js'></script>
        <script type='text/javascript' src='./js/jquery.wysiwyg.js'></script>
        <script type='text/javascript' src='./js/visualize.jQuery.js'></script>
       <script type='application/javascript' src='./js/functions.js'></script>
</html>
